﻿using Myu.Redis.Init;
using Myu.Redis.Service;
using ServiceStack.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestRedix
{
    class Program
    {
        static void Main(string[] args)
        {



            Console.WriteLine("订阅");


           

            using (RedisListService service = new RedisListService())
            {
                service.Subscribe("myu", (c, message, iRedisSubscription) => {
                    Console.WriteLine($"注册{1}{c}:{message}，Dosomething else");
                    if (message.Equals("exit"))
                        iRedisSubscription.UnSubscribeFromChannels("myu");
                });
            }

            Console.ReadKey();

        }
    }
}
